#include <REGx52.H>
/*
	接收方执行程序
*/
unsigned char i=5,z;
unsigned char code num[] = {0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x90, 0x88, 0x83, 0xc6, 0xa1, 0x86, 0x8e, 0xbf, 0xbf, 0xff, 0x89};
unsigned int tmp[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

void URAT_init()
{
	SCON = 0x50;
	TMOD = 0x20;
	TH1 = 0xfd;
	TL1 = 0xfd;
	
	EA = 1;
	ES = 1;
	TR1 = 1;
}

void Timer2() interrupt 4 //定义服务函数
{
	for(;z<9;z++)
	{
		while(RI == 0);
		tmp[z] = SBUF;
		RI = 0;
	}
	

}
void main()
{
	URAT_init();
	while(1)
	{
		P2=0x01 << z;
		P1=num[tmp[z]];
		z++;
		if(z == 8)
		{
		 z=0;
		}
	}
}

